package com.benmei.ntlive.constant;

/**
 * Created by Peter on 2017/8/21.
 */
public enum Action {
    intoRoom(1, "intoRoom"),

    intoRoomNotify(2, "intoRoomNotify"),

    applyStartLive(3, "applyStartLive"),

    liveStartNotify(4, "liveStartNotify"),

    startWatchVideo(5, "startWatchVideo"),

    applyJoin(6, "applyJoin"),

    agreeJoin(7, "agreeJoin"),

    joinSuccessNotify(8, "joinSuccessNotify");

    private final int value;

    private final String name;


    Action(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static boolean isValidateAction(String name) {
        boolean result = false;
        for (Action action : Action.values()) {
            if (action.name.equals(name)) {
                result = true;
                break;
            }
        }
        return result;
    }


}
